# Copyright (c) 2021 Presto Labs Pte. Ltd.
# Author: jasonyoon
import git
import fire


def get_fastfeature_commitid():
  commitid = "HEAD"
  with open("WORKSPACE", "r") as fin:
    for line in fin:
      if "fastfeature" in line:
        break
    for line in fin:
      if "commit" in line:
        commitid = line.strip().split()[-1][1:-2]
        break
  return commitid


def get_commit_msg():
  return git.Repo(search_parent_directories=True).head.commit.message


if __name__ == "__main__":
  fire.Fire()
